home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.2 Development Libraries / SGI IRIX 6.2 Development Libraries.iso / dist / sgitcl_dev.idb / usr / sgitcl / include / ComboBoxP.h.z / ComboBoxP.h
C/C++ Source or Header  |  1996-03-14  |  6KB  |  185 lines

  1. /*
  2.  * ComboBoxP.h, Interleaf, 16aug93 2:37pm Version 1.1.
  3.  */
  4. /***********************************************************
  5. Copyright 1993 Interleaf, Inc.
  6.  
  7. Permission to use, copy, modify, and distribute this software
  8. and its documentation for any purpose without fee is granted,
  9. provided that the above copyright notice appear in all copies
  10. and that both copyright notice and this permission notice appear
  11. in supporting documentation, and that the name of Interleaf not
  12. be used in advertising or publicly pertaining to distribution of
  13. the software without specific written prior permission.
  14.  
  15. Interleaf makes no representation about the suitability of this
  16. software for any purpose. It is provided "AS IS" without any
  17. express or implied warranty. 
  18. ******************************************************************/
  19.  
  20. /*
  21.  * (C) Copyright 1991,1992, 1993
  22.  * Interleaf, Inc.
  23.  * Nine Hillside Avenue, Waltham, MA  02154
  24.  *
  25.  * ComboBoxP.h:
  26.  * 
  27.  * Private header file for DtComboBoxWidget.
  28.  */
  29. #ifndef _ComboBoxP_h
  30. #define _ComboBoxP_h
  31.  
  32. #ifndef AA
  33. #define AA(args) ()
  34. #endif
  35.  
  36. #include <X11/IntrinsicP.h>
  37. #include <X11/ShellP.h>
  38. #include <Xm/DrawnB.h>
  39. #include <Xm/ArrowB.h>
  40. #include <Xm/TextFP.h>
  41. #include <Xm/Label.h>
  42. #include <Xm/Frame.h>
  43. #include <Xm/ListP.h>
  44. #include <Xm/Separator.h>
  45. #include <Xm/ScrolledWP.h>
  46. #include <Xm/ScrollBarP.h>
  47.  
  48. #include <Xm/ManagerP.h>
  49. #include "ComboBox.h"
  50.  
  51. /*
  52.  * External definitions of syn_resources for our list widget.
  53.  */
  54. #define SYN_RESOURCE_AA (Widget w, int resource_offset, XtArgVal *value)
  55. extern void _DtComboBoxGetArrowSize        SYN_RESOURCE_AA;
  56. extern void _DtComboBoxGetLabelString        SYN_RESOURCE_AA;
  57. extern void _DtComboBoxGetListItemCount        SYN_RESOURCE_AA;
  58. extern void _DtComboBoxGetListItems        SYN_RESOURCE_AA;
  59. extern void _DtComboBoxGetListFontList        SYN_RESOURCE_AA;
  60. extern void _DtComboBoxGetListMarginHeight    SYN_RESOURCE_AA;
  61. extern void _DtComboBoxGetListMarginWidth    SYN_RESOURCE_AA;
  62. extern void _DtComboBoxGetListSpacing        SYN_RESOURCE_AA;
  63. extern void _DtComboBoxGetListTopItemPosition    SYN_RESOURCE_AA;
  64. extern void _DtComboBoxGetListVisibleItemCount    SYN_RESOURCE_AA;
  65.  
  66. #define ARROW_MULT        .45
  67. #define ARROW_MIN        13
  68. #define MARGIN            2
  69. #define LABEL_PADDING        2
  70. #define LABEL_SHADOW        2
  71. #define TEXT_FIELD_SHADOW   1
  72.  
  73. /* 
  74.  * Class Records
  75.  */
  76. typedef struct {
  77.     Boolean junk;  /* Need something */
  78. } DtComboBoxClassPart;
  79.  
  80. typedef struct _DtComboBoxClassRec {
  81.     CoreClassPart        core_class;
  82.     CompositeClassPart        composite_class;
  83.     ConstraintClassPart        constraint_class;
  84.     XmManagerClassPart        manager_class;
  85.     DtComboBoxClassPart        combo_box_class;
  86. } DtComboBoxClassRec;
  87.  
  88. extern DtComboBoxClassRec dtComboBoxClassRec;
  89.  
  90.  
  91. /*
  92.  * Instance Record.
  93.  */
  94. typedef struct _DtComboBoxPart {
  95.     /* Private data */
  96.     Widget arrow;
  97.     Widget shell;
  98.     Widget frame;
  99.     Widget label;
  100.     Widget sep;
  101.     Dimension old_width;
  102.     Dimension old_height;
  103.     Dimension label_max_length;
  104.     Dimension label_max_height;
  105.     /* 
  106.      * max_shell_width is the width that is needed to hold the
  107.      * list if the longest item was visible.  We then use this
  108.      * width to figure out if the shell is not wide enough,
  109.      * when it gets popped on the screen.  This is needed in case the
  110.      * combo-box resizes, or if items changes (list will resize).
  111.      * Sometimes we change the size of the shell to fit on the screen, or
  112.      * to make it at least as large as the combo_box.  The next time we pop
  113.      * the shell up the size may be different; therefore, we set the shell
  114.      * size to the maximum everytime it gets popped up, then we will
  115.      * make adjustments, only if needed.
  116.      * This value gets saved every time the user updates XmNitems.
  117.      */
  118.     Dimension max_shell_width;
  119.     Dimension max_shell_height;
  120.  
  121.     /* ComboBox specific resources */
  122.     XtCallbackList activate_callback;
  123.     unsigned char alignment;
  124.     Dimension arrow_size;
  125.     Dimension arrow_spacing;
  126.     unsigned char arrow_type;
  127.     short text_columns;
  128.     XtCallbackList focus_callback;
  129.     Dimension horizontal_spacing;
  130.     int item_count;
  131.     XmStringTable items;
  132.     XmString label_string;
  133.     Widget list;
  134.     XmFontList list_font_list;
  135.     Dimension list_margin_height;
  136.     Dimension list_margin_width;
  137.     Dimension list_spacing;
  138.     XtCallbackList losing_focus_callback;
  139.     Dimension margin_height;
  140.     Dimension margin_width;
  141.     unsigned int text_max_length;
  142.     XtCallbackList menu_post_callback;
  143.     unsigned char orientation;
  144.     Boolean popped_up;
  145.     Boolean recompute_size;
  146.     XmString selected_item;
  147.     unsigned int selected_position;
  148.     XtCallbackList selection_callback;
  149.     Widget text;
  150.     int top_item_position;
  151.     unsigned char type;
  152.     Boolean update_label;
  153.     Dimension vertical_spacing;
  154.     int visible_item_count;
  155. } DtComboBoxPart;
  156.  
  157.  
  158. typedef struct _DtComboBoxRec {
  159.     CorePart        core;
  160.     CompositePart    composite;
  161.     ConstraintPart    constraint;
  162.     XmManagerPart    manager;
  163.     DtComboBoxPart    combo_box;
  164. } DtComboBoxRec;
  165.  
  166.  
  167. /*
  168.  * Error defines.
  169.  */
  170. #define COMBO_ALIGNMENT "DtComboButtonWidget: Invalid alignment resource (defaulting to XmALIGNMENT_CENTER)."
  171. #define COMBO_MARGIN_HEIGHT "DtComboButtonWidget: Invalid marginHeight resource (defaulting to 2)."
  172. #define COMBO_MARGIN_WIDTH "DtComboButtonWidget: Invalid marginHeight resource (defaulting to 2)."
  173. #define COMBO_HORIZONTAL_SPACING "DtComboButtonWidget: Invalid horizontalSpacing resource (defaulting to 0)."
  174. #define COMBO_VERTICAL_SPACING "DtComboButtonWidget: Invalid verticalSpacing resource (defaulting to 0)."
  175. #define COMBO_ORIENTATION "DtComboButtonWidget: Invalid orientation resource (defaulting to XmRIGHT)."
  176. #define COMBO_ITEM_COUNT "DtComboButtonWidget: Invalid itemCount resource (defaulting to 0)."
  177. #define COMBO_VISIBLE_ITEM "DtComboButtonWidget: Invalid selectedPosition resource (defaulting to 0)."
  178. #define COMBO_TEXT "DtComboButtonWidget: Unable to set textField resource."
  179. #define COMBO_ITEM_COUNT "DtComboButtonWidget: Invalid itemCount resource (defaulting to 0)."
  180. #define COMBO_SET_ITEM "DtComboBoxWidget: Unable to find item to set (DtComboBoxSetItem)."
  181. #define COMBO_SELECT_ITEM "DtComboBoxWidget: Unable to find item to select (DtComboBoxSelectItem)."
  182.  
  183.  
  184. #endif /* _ComboBoxP_h */
  185.